package top.kaoshanji.r3ch11b;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * @author kaoshanji
 * ^_^
 * create time 2025/5/9 11:14
 */
@Repository
public class ForumDao {

    private JdbcTemplate jdbcTemplate;

    @Autowired
    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
        this.jdbcTemplate = jdbcTemplate;
    }

    public void addForum(final Forum forum) {
        final String sql = " INSERT INTO t_forum(forum_name,forum_desc) VALUES(?,?) ";
        jdbcTemplate.update(sql, forum.getForumName(), forum.getForumDesc());
    }

}
